/*
 * @Author: 张小平
 * @Date:   2025-05-01 
 * @Email:  qqshuqian@163.com 
 * @Copyright © 2024 aseyun. All rights reserved.
 */
import {isURL} from './validate'
/**
 * auve Router 保留 处理路由,获取跳转路径
 */
function objToform(obj) {
  let result = []
  Object.keys(obj).forEach(ele => {
    result.push(`${ele}=${obj[ele]}`)
  })
  return result.join('&')
}

export const getPath = (params = {}, meta = {}) => {
  let { src } = params
  let result = src || '/'
  if (isURL(src)) {
    result = `/myiframe/urlPath?${objToform(Object.assign(meta, params))}`
  }
  return result
}
